package com.dyp.security_demo.ctr;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

@RestController
@RequestMapping("/v1")
public class UserResourceV1 {

    @GetMapping("/all")
    public List<String> getAllUserName() {
        List<String> ALLOWED_ORDERED_PROPERTIES = Collections.unmodifiableList(
                Arrays.asList(
                        "id",
                        "login",
                        "firstName",
                        "lastName",
                        "email",
                        "activated",
                        "langKey",
                        "createdBy",
                        "createdDate",
                        "lastModifiedBy",
                        "lastModifiedDate"
                ));
        return  ALLOWED_ORDERED_PROPERTIES;
    }

    @GetMapping("/user/role")
    public String createUser(){
        return "create user info";
    }

    @GetMapping("/admin/role")
    public String getAll(){
        return "all thing";
    }
}
